global class Demo_Bulk implements Database.Batchable<Sobject>{
	

global Database.QueryLocator start(Database.BatchableContext BC){
return Database.getQueryLocator([select id,Name,AccountId, Account.Name,Account.phone, Account.SLASerialNumber__c from Opportunity where Accountid='001A000000TnQMk']);
//return Database.getQueryLocator([select id,Name,(Select id,Name,Amount from Opportunities)from Account where id='001A000000TnQMk']);


}
global void execute(Database.BatchableContext BC, List<sObject> scope){

List<Opportunity> listopp=new List<Opportunity>();

for(Sobject o : scope){
	Opportunity optype=(Opportunity)o;
	listopp.add(optype);
	
}
for(Opportunity opdetails:listopp)
{
	System.debug('details1-->'+opdetails.Name);
	System.debug('details2-->'+opdetails.ID);
	System.debug('details3-->'+opdetails.AccountId);
	System.debug('details4-->'+opdetails.Account.phone);
	System.debug('details5-->'+opdetails.Account.SLASerialNumber__c);
		
}
//update scope;
}
global void finish(Database.BatchableContext BC){
}

}